Don't hang during large yanks
authorRob Browning <rlb@defaultvalue.org>
Sat, 19 Sep 2015 19:47:57 +0000 (14:47 -0500)
committerRob Browning <rlb@defaultvalue.org>
Sat, 19 Sep 2015 19:48:01 +0000 (14:48 -0500)
Add 0009-Emacs-should-no-longer-hang-during-large-yanks.patch to
incorporate the relevant upstream patch.  Thanks to Mike Crowe
<mac@mcrowe.com> for reporting the problem and tracking down the fix.

Closes: 795909
1  2 
debian/.git-dpm
debian/patches/0009-Emacs-should-no-longer-hang-during-large-yanks.patch
debian/patches/series

diff --cc debian/.git-dpm
index b5567b9c9809b93d53babf13fc9e488075efca21,0000000000000000000000000000000000000000..36fd5106e8d89504380dc1748b5a99ee4e3a28ea
mode 100644,000000..100644
--- /dev/null
@@@ -1,8 -1,0 +1,8 @@@
- 59467953c905b8d1c015dec9ba41df38af3df30e
- 59467953c905b8d1c015dec9ba41df38af3df30e
 +# see git-dpm(1) from git-dpm package
++329df01a7150bec89e58cfa6ba9e26b31169a23d
++329df01a7150bec89e58cfa6ba9e26b31169a23d
 +62bc68f777c532a970566625e315d68bf0ab4eee
 +62bc68f777c532a970566625e315d68bf0ab4eee
 +emacs24_24.5+1.orig.tar.bz2
 +790a17cf600831dd5c36afddb9cb48bc5482e6c9
 +24401779
index 0000000000000000000000000000000000000000,0000000000000000000000000000000000000000..a426825516ca12984c3376452053f1f09543a4fa
new file mode 100644 (file)
--- /dev/null
--- /dev/null
@@@ -1,0 -1,0 +1,105 @@@
++From 329df01a7150bec89e58cfa6ba9e26b31169a23d Mon Sep 17 00:00:00 2001
++From: Paul Eggert <eggert@cs.ucla.edu>
++Date: Fri, 17 Jul 2015 11:54:24 -0700
++Subject: Emacs should no longer hang during large yanks
++
++This upstream patch has been added:
++
++  Fix hang with large yanks
++
++  Backport of master commit 0592cefd03f1de2f04b721d07a16e6e0a9e48f73.
++  This should fix the bug fixed by Mike Crowe's patch in:
++  https://lists.gnu.org/archive/html/emacs-devel/2015-07/msg00106.html
++  A problem in this area has been reported by several users; see
++  Bug#16737, Bug#17101, Bug#17026, Bug#17172, Bug#19320, Bug#20283.
++  This fix differs from Mike Crowe's patch in that it should avoid a
++  race condition that could lose SIGIO signals.  ignore_sigio dates
++  back to the 1980s when some platforms couldn't block signals, and
++  could only ignore them, which led to races when signals arrived
++  while being ignored.  We shouldn't have to worry about those old
++  platforms now.
++  * src/dispextern.h, src/sysdep.c (ignore_sigio): Remove.
++  * src/emacs.c (shut_down_emacs):
++  Don't call ignore_sigio; unrequest_sigio should suffice.
++  * src/keyboard.c (kbd_buffer_store_buffered_event):
++  Use unrequest_sigio, not ignore_sigio.
++  (kbd_buffer_get_event):
++  Call request_sigio when getting the ball rolling again.
++
++Origin: upstream, commit: a27ae9d7650a1230d4359eaf0a949f827315a6d2
++Bug: http://debbugs.gnu.org/16737
++Bug-Debian: http://bugs.debian.org/795909
++Added-by: Rob Browning <rlb@defaultvalue.org>
++---
++ src/dispextern.h | 1 -
++ src/emacs.c      | 1 -
++ src/keyboard.c   | 4 ++--
++ src/sysdep.c     | 9 ---------
++ 4 files changed, 2 insertions(+), 13 deletions(-)
++
++diff --git a/src/dispextern.h b/src/dispextern.h
++index 239c442..cf3d1ec 100644
++--- a/src/dispextern.h
+++++ b/src/dispextern.h
++@@ -3349,7 +3349,6 @@ void unrequest_sigio (void);
++ bool tabs_safe_p (int);
++ void init_baud_rate (int);
++ void init_sigio (int);
++-void ignore_sigio (void);
++ 
++ /* Defined in xfaces.c.  */
++ 
++diff --git a/src/emacs.c b/src/emacs.c
++index 9b78a70..b5d3ab4 100644
++--- a/src/emacs.c
+++++ b/src/emacs.c
++@@ -2028,7 +2028,6 @@ shut_down_emacs (int sig, Lisp_Object stuff)
++   /* There is a tendency for a SIGIO signal to arrive within exit,
++      and cause a SIGHUP because the input descriptor is already closed.  */
++   unrequest_sigio ();
++-  ignore_sigio ();
++ 
++   /* Do this only if terminating normally, we want glyph matrices
++      etc. in a core dump.  */
++diff --git a/src/keyboard.c b/src/keyboard.c
++index 945019e..77af44a 100644
++--- a/src/keyboard.c
+++++ b/src/keyboard.c
++@@ -3663,8 +3663,7 @@ kbd_buffer_store_event_hold (register struct input_event *event,
++           /* Don't read keyboard input until we have processed kbd_buffer.
++              This happens when pasting text longer than KBD_BUFFER_SIZE/2.  */
++           hold_keyboard_input ();
++-          if (!noninteractive)
++-            ignore_sigio ();
+++          unrequest_sigio ();
++           stop_polling ();
++         }
++ #endif       /* subprocesses */
++@@ -3829,6 +3828,7 @@ kbd_buffer_get_event (KBOARD **kbp,
++       /* Start reading input again because we have processed enough to
++          be able to accept new events again.  */
++       unhold_keyboard_input ();
+++      request_sigio ();
++       start_polling ();
++     }
++ #endif       /* subprocesses */
++diff --git a/src/sysdep.c b/src/sysdep.c
++index 01692c2..4b4801d 100644
++--- a/src/sysdep.c
+++++ b/src/sysdep.c
++@@ -649,15 +649,6 @@ unrequest_sigio (void)
++   interrupts_deferred = 1;
++ #endif
++ }
++-
++-void
++-ignore_sigio (void)
++-{
++-#ifdef USABLE_SIGIO
++-  signal (SIGIO, SIG_IGN);
++-#endif
++-}
++-
++ \f
++ /* Saving and restoring the process group of Emacs's terminal.  */
++ 
index 68c50717b75fedf116d1b4a29b6e64f0a94bb589,0000000000000000000000000000000000000000..140835c7a9091c3ff7595201a4b6d9fddedd2298
mode 100644,000000..100644
--- /dev/null
@@@ -1,8 -1,0 +1,9 @@@
 +0001-Prefer-usr-share-info-emacs-24-over-usr-share-info.patch
 +0002-Run-debian-startup-and-set-debian-emacs-flavor.patch
 +0003-Remove-files-that-appear-to-be-incompatible-with-the.patch
 +0004-Adjust-documentation-references-for-Debian.patch
 +0005-Modify-the-output-of-version-to-indicate-Debian-modi.patch
 +0006-Look-for-NEWS-in-order-to-find-etc-rather-than-GNU.patch
 +0007-Don-t-try-to-build-src-macuvs.h-via-IVD_Sequences.tx.patch
 +0008-Emacs-won-t-assume-grep-supports-GREP_OPTIONS.patch
++0009-Emacs-should-no-longer-hang-during-large-yanks.patch